package cn.crce.cloud9.simple;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Date;

/**
 * @author OnCloud9
 * @description
 * @project NRCE-TEST
 * @date 2022年09月10日 上午 10:15
 */
public class Case32 {
    public static void main(String[] args){
//*********Found**********
        ActionListener listener = new TimePrinter();
        Timer t = new Timer(10000, listener);
        t.start();
        JOptionPane.showMessageDialog(null, "退出程序吗?");
        System.exit(0);
    }
}

//*********Found**********
class TimePrinter implements ActionListener {
    //*********Found**********
    public void actionPerformed(ActionEvent event){
        Date now = new Date();
        System.out.println("At the tone, the time is " + now);
        Toolkit.getDefaultToolkit().beep();
    }
}
